const { name } = require("./package.json");

module.exports = {
  webpack: (config) => {
    config.output.library = `${name}=[name]`;
    config.output.libraryTarget = "umd";
    // config.output.jsonpFunction = `webpackJsonp_${name}`;
    config.output.globalObject = "window";

    return config;
  },
  devServer: (_) => {
    console.log("走了配置文件");

    const config = _;
    config.port = 3011;
    // port: 3001, // 指定端口
    config.headers = {
      "Access-control-Allow-Origin": "*",
    };
    config.historyApiFallback = true;
    config.hot = false;
    // config.watchContentBass = false;
    config.liveReload = false;

    return config;
  },
};
